<template>
  <view class="my-search-container">
    <view class="my-search-box" @click="handleClick"> 
      <!-- 搜索图标 -->
       <image class="search-icon" src="/static/my-icons/search.png" mode="widthFix"></image>
      <!-- 搜索文本 -->
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script setup>
const emit = defineEmits()
function handleClick(){
  emit('click');
}
</script>

<style lang="scss">
.my-search-container {
  height: 50px;
  background: #c00000;
  display: flex;
  padding: 0 10px;
  align-items: center;
  .my-search-box {
    height: 36px;
    background-color: #fff;
    border-radius: 18px;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0 10px; // 增加内边距，使图标和文本不贴边

    .search-icon {
      width: 22px;
      height: 22px;
      margin-right: 10px;
      margin-top: 3px;
    }

    .placeholder {
      font-size: 15px;
      color: #999;
    }
  }
}
</style>
